

<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
  <meta charset="utf-8" />
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  
  <title>RGW Service &mdash; Ceph Documentation</title>
  

  
  <link rel="stylesheet" href="../../../_static/ceph.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/graphviz.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/css/custom.css" type="text/css" />

  
  
    <link rel="shortcut icon" href="../../../_static/favicon.ico"/>
  

  
  

  

  
  <!--[if lt IE 9]>
    <script src="../../../_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
        <script src="../../../_static/jquery.js"></script>
        <script src="../../../_static/underscore.js"></script>
        <script src="../../../_static/doctools.js"></script>
    
    <script type="text/javascript" src="../../../_static/js/theme.js"></script>

    
    <link rel="index" title="Index" href="../../../genindex/" />
    <link rel="search" title="Search" href="../../../search/" />
    <link rel="next" title="MDS Service" href="../mds/" />
    <link rel="prev" title="OSD Service" href="../osd/" /> 
</head>

<body class="wy-body-for-nav">

   
  <header class="top-bar">
    

















<div role="navigation" aria-label="breadcrumbs navigation">

  <ul class="wy-breadcrumbs">
    
      <li><a href="../../../" class="icon icon-home"></a> &raquo;</li>
        
          <li><a href="../../">Cephadm</a> &raquo;</li>
        
          <li><a href="../">Service Management</a> &raquo;</li>
        
      <li>RGW Service</li>
    
    
      <li class="wy-breadcrumbs-aside">
        
          
            <a href="../../../_sources/cephadm/services/rgw.rst.txt" rel="nofollow"> View page source</a>
          
        
      </li>
    
  </ul>

  
  <hr/>
</div>
  </header>
  <div class="wy-grid-for-nav">
    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search"  style="background: #eee" >
          

          
            <a href="../../../">
          

          
            
            <img src="../../../_static/logo.png" class="logo" alt="Logo"/>
          
          </a>

          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../../../search/" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        
        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../../start/intro/">Ceph 简介</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../install/">安装 Ceph</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../../">Cephadm</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../../compatibility/">Compatibility and Stability</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../install/">部署个全新的 Ceph 集群</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../adoption/">现有集群切换到 cephadm</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../host-management/">Host Management</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../">Service Management</a><ul class="current">
<li class="toctree-l3"><a class="reference internal" href="../mon/">MON Service</a></li>
<li class="toctree-l3"><a class="reference internal" href="../mgr/">MGR Service</a></li>
<li class="toctree-l3"><a class="reference internal" href="../osd/">OSD Service</a></li>
<li class="toctree-l3 current"><a class="current reference internal" href="#">RGW Service</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#deploy-rgws">Deploy RGWs</a></li>
<li class="toctree-l4"><a class="reference internal" href="#high-availability-service-for-rgw">High availability service for RGW</a></li>
<li class="toctree-l4"><a class="reference internal" href="#further-reading">Further Reading</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../mds/">MDS Service</a></li>
<li class="toctree-l3"><a class="reference internal" href="../nfs/">NFS Service</a></li>
<li class="toctree-l3"><a class="reference internal" href="../iscsi/">iSCSI Service</a></li>
<li class="toctree-l3"><a class="reference internal" href="../custom-container/">Custom Container Service</a></li>
<li class="toctree-l3"><a class="reference internal" href="../monitoring/">Monitoring Services</a></li>
<li class="toctree-l3"><a class="reference internal" href="../snmp-gateway/">SNMP Gateway Service</a></li>
<li class="toctree-l3"><a class="reference internal" href="../#service-status">Service Status</a></li>
<li class="toctree-l3"><a class="reference internal" href="../#daemon-status">Daemon Status</a></li>
<li class="toctree-l3"><a class="reference internal" href="../#service-specification">Service Specification</a></li>
<li class="toctree-l3"><a class="reference internal" href="../#daemon-placement">Daemon Placement</a></li>
<li class="toctree-l3"><a class="reference internal" href="../#removing-a-service">Removing a Service</a></li>
<li class="toctree-l3"><a class="reference internal" href="../#disabling-automatic-deployment-of-daemons">Disabling automatic deployment of daemons</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../../upgrade/">Ceph 的升级</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../operations/">Cephadm operations</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../client-setup/">Client Setup</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../troubleshooting/">Troubleshooting</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../dev/cephadm/">Cephadm Feature Planning</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../../rados/">Ceph 存储集群</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../cephfs/">Ceph 文件系统</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../rbd/">Ceph 块设备</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../radosgw/">Ceph 对象网关</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../mgr/">Ceph 管理器守护进程</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../mgr/dashboard/">Ceph 仪表盘</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../api/">API 文档</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../architecture/">体系结构</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../dev/developer_guide/">开发者指南</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../dev/internals/">Ceph 内幕</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../governance/">项目管理</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../foundation/">Ceph 基金会</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../ceph-volume/">ceph-volume</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../releases/general/">Ceph 版本（总目录）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../releases/">Ceph 版本（索引）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../security/">Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../glossary/">Ceph 术语</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../jaegertracing/">Tracing</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../translation_cn/">中文版翻译资源</a></li>
</ul>

            
          
        </div>
        
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../../../">Ceph</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
<div id="dev-warning" class="admonition note">
  <p class="first admonition-title">Notice</p>
  <p class="last">This document is for a development version of Ceph.</p>
</div>
  <div id="docubetter" align="right" style="padding: 5px; font-weight: bold;">
    <a href="https://pad.ceph.com/p/Report_Documentation_Bugs">Report a Documentation Bug</a>
  </div>

  
  <div class="section" id="rgw-service">
<h1>RGW Service<a class="headerlink" href="#rgw-service" title="Permalink to this headline">¶</a></h1>
<div class="section" id="deploy-rgws">
<span id="cephadm-deploy-rgw"></span><h2>Deploy RGWs<a class="headerlink" href="#deploy-rgws" title="Permalink to this headline">¶</a></h2>
<p>Cephadm deploys radosgw as a collection of daemons that manage a
single-cluster deployment or a particular <em>realm</em> and <em>zone</em> in a
multisite deployment.  (For more information about realms and zones,
see <a class="reference internal" href="../../../radosgw/multisite/#multisite"><span class="std std-ref">多站</span></a>.)</p>
<p>Note that with cephadm, radosgw daemons are configured via the monitor
configuration database instead of via a <cite>ceph.conf</cite> or the command line.  If
that configuration isn’t already in place (usually in the
<code class="docutils literal notranslate"><span class="pre">client.rgw.&lt;something&gt;</span></code> section), then the radosgw
daemons will start up with default settings (e.g., binding to port
80).</p>
<p>To deploy a set of radosgw daemons, with an arbitrary service name
<em>name</em>, run the following command:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><style type="text/css">
span.prompt1:before {
  content: "# ";
}
</style><span class="prompt1">ceph orch apply rgw *&lt;name&gt;* <span class="o">[</span>--realm<span class="o">=</span>*&lt;realm-name&gt;*<span class="o">]</span> <span class="o">[</span>--zone<span class="o">=</span>*&lt;zone-name&gt;*<span class="o">]</span> --placement<span class="o">=</span><span class="s2">&quot;*&lt;num-daemons&gt;* [*&lt;host1&gt;* ...]&quot;</span></span>
</pre></div></div><div class="section" id="trivial-setup">
<h3>Trivial setup<a class="headerlink" href="#trivial-setup" title="Permalink to this headline">¶</a></h3>
<p>For example, to deploy 2 RGW daemons (the default) for a single-cluster RGW deployment
under the arbitrary service id <em>foo</em>:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph orch apply rgw foo</span>
</pre></div></div></div>
<div class="section" id="designated-gateways">
<h3>Designated gateways<a class="headerlink" href="#designated-gateways" title="Permalink to this headline">¶</a></h3>
<p>A common scenario is to have a labeled set of hosts that will act
as gateways, with multiple instances of radosgw running on consecutive
ports 8000 and 8001:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph orch host label add gwhost1 rgw  <span class="c1"># the &#39;rgw&#39; label can be anything</span></span>
<span class="prompt1">ceph orch host label add gwhost2 rgw</span>
<span class="prompt1">ceph orch apply rgw foo <span class="s1">&#39;--placement=label:rgw count-per-host:2&#39;</span> --port<span class="o">=</span><span class="m">8000</span></span>
</pre></div></div></div>
<div class="section" id="specifying-networks">
<span id="cephadm-rgw-networks"></span><h3>Specifying Networks<a class="headerlink" href="#specifying-networks" title="Permalink to this headline">¶</a></h3>
<p>The RGW service can have the network they bind to configured with a yaml service specification.</p>
<p>example spec file:</p>
<div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="nt">service_type</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">rgw</span>
<span class="nt">service_name</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">foo</span>
<span class="nt">placement</span><span class="p">:</span>
  <span class="nt">label</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">rgw</span>
  <span class="nt">count-per-host</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">2</span>
<span class="nt">networks</span><span class="p">:</span>
<span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">192.169.142.0/24</span>
<span class="nt">spec</span><span class="p">:</span>
  <span class="nt">port</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">8000</span>
</pre></div>
</div>
</div>
<div class="section" id="multisite-zones">
<h3>Multisite zones<a class="headerlink" href="#multisite-zones" title="Permalink to this headline">¶</a></h3>
<p>To deploy RGWs serving the multisite <em>myorg</em> realm and the <em>us-east-1</em> zone on
<em>myhost1</em> and <em>myhost2</em>:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph orch apply rgw east --realm<span class="o">=</span>myorg --zone<span class="o">=</span>us-east-1 --placement<span class="o">=</span><span class="s2">&quot;2 myhost1 myhost2&quot;</span></span>
</pre></div></div><p>Note that in a multisite situation, cephadm only deploys the daemons.  It does not create
or update the realm or zone configurations.  To create a new realm and zone, you need to do
something like:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">radosgw-admin realm create --rgw-realm<span class="o">=</span>&lt;realm-name&gt; --default</span>
</pre></div></div><div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">radosgw-admin zonegroup create --rgw-zonegroup<span class="o">=</span>&lt;zonegroup-name&gt;  --master --default</span>
</pre></div></div><div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">radosgw-admin zone create --rgw-zonegroup<span class="o">=</span>&lt;zonegroup-name&gt; --rgw-zone<span class="o">=</span>&lt;zone-name&gt; --master --default</span>
</pre></div></div><div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">radosgw-admin period update --rgw-realm<span class="o">=</span>&lt;realm-name&gt; --commit</span>
</pre></div></div><p>See <a class="reference internal" href="../#orchestrator-cli-placement-spec"><span class="std std-ref">Daemon Placement</span></a> for details of the placement
specification.  See <a class="reference internal" href="../../../radosgw/multisite/#multisite"><span class="std std-ref">多站</span></a> for more information of setting up multisite RGW.</p>
<p>See also <a class="reference internal" href="../../../radosgw/multisite/#multisite"><span class="std std-ref">多站</span></a>.</p>
</div>
<div class="section" id="setting-up-https">
<h3>Setting up HTTPS<a class="headerlink" href="#setting-up-https" title="Permalink to this headline">¶</a></h3>
<p>In order to enable HTTPS for RGW services, apply a spec file following this scheme:</p>
<div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="nt">service_type</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">rgw</span>
<span class="nt">service_id</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">myrgw</span>
<span class="nt">spec</span><span class="p">:</span>
  <span class="nt">rgw_frontend_ssl_certificate</span><span class="p">:</span> <span class="p p-Indicator">|</span>
    <span class="no">-----BEGIN PRIVATE KEY-----</span>
    <span class="no">V2VyIGRhcyBsaWVzdCBpc3QgZG9vZi4gTG9yZW0gaXBzdW0gZG9sb3Igc2l0IGFt</span>
    <span class="no">ZXQsIGNvbnNldGV0dXIgc2FkaXBzY2luZyBlbGl0ciwgc2VkIGRpYW0gbm9udW15</span>
    <span class="no">IGVpcm1vZCB0ZW1wb3IgaW52aWR1bnQgdXQgbGFib3JlIGV0IGRvbG9yZSBtYWdu</span>
    <span class="no">YSBhbGlxdXlhbSBlcmF0LCBzZWQgZGlhbSB2b2x1cHR1YS4gQXQgdmVybyBlb3Mg</span>
    <span class="no">ZXQgYWNjdXNhbSBldCBqdXN0byBkdW8=</span>
    <span class="no">-----END PRIVATE KEY-----</span>
    <span class="no">-----BEGIN CERTIFICATE-----</span>
    <span class="no">V2VyIGRhcyBsaWVzdCBpc3QgZG9vZi4gTG9yZW0gaXBzdW0gZG9sb3Igc2l0IGFt</span>
    <span class="no">ZXQsIGNvbnNldGV0dXIgc2FkaXBzY2luZyBlbGl0ciwgc2VkIGRpYW0gbm9udW15</span>
    <span class="no">IGVpcm1vZCB0ZW1wb3IgaW52aWR1bnQgdXQgbGFib3JlIGV0IGRvbG9yZSBtYWdu</span>
    <span class="no">YSBhbGlxdXlhbSBlcmF0LCBzZWQgZGlhbSB2b2x1cHR1YS4gQXQgdmVybyBlb3Mg</span>
    <span class="no">ZXQgYWNjdXNhbSBldCBqdXN0byBkdW8=</span>
    <span class="no">-----END CERTIFICATE-----</span>
  <span class="nt">ssl</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">true</span>
</pre></div>
</div>
<p>Then apply this yaml document:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span class="prompt1">ceph orch apply -i myrgw.yaml</span>
</pre></div></div><p>Note the value of <code class="docutils literal notranslate"><span class="pre">rgw_frontend_ssl_certificate</span></code> is a literal string as
indicated by a <code class="docutils literal notranslate"><span class="pre">|</span></code> character preserving newline characters.</p>
</div>
<div class="section" id="service-specification">
<h3>Service specification<a class="headerlink" href="#service-specification" title="Permalink to this headline">¶</a></h3>
<dl class="py class">
<dt id="ceph.deployment.service_spec.RGWSpec">
<em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">ceph.deployment.service_spec.</span></code><code class="sig-name descname"><span class="pre">RGWSpec</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">service_type</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'rgw'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">service_id</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">placement</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">rgw_realm</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">rgw_zone</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">rgw_frontend_port</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">rgw_frontend_ssl_certificate</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">rgw_frontend_type</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">unmanaged</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">ssl</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">preview_only</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">config</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">networks</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">subcluster</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#ceph.deployment.service_spec.RGWSpec" title="Permalink to this definition">¶</a></dt>
<dd><p>Settings to configure a (multisite) Ceph RGW</p>
<div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="nt">service_type</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">rgw</span>
<span class="nt">service_id</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">myrealm.myzone</span>
<span class="nt">spec</span><span class="p">:</span>
    <span class="nt">rgw_realm</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">myrealm</span>
    <span class="nt">rgw_zone</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">myzone</span>
    <span class="nt">ssl</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">true</span>
    <span class="nt">rgw_frontend_port</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">1234</span>
    <span class="nt">rgw_frontend_type</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">beast</span>
    <span class="nt">rgw_frontend_ssl_certificate</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">...</span>
</pre></div>
</div>
<p>See also: <a class="reference internal" href="../#orchestrator-cli-service-spec"><span class="std std-ref">Service Specification</span></a></p>
<dl class="py attribute">
<dt id="ceph.deployment.service_spec.RGWSpec.rgw_frontend_port">
<code class="sig-name descname"><span class="pre">rgw_frontend_port</span></code><em class="property"><span class="pre">:</span> <span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">int</span><span class="p"><span class="pre">]</span></span></em><a class="headerlink" href="#ceph.deployment.service_spec.RGWSpec.rgw_frontend_port" title="Permalink to this definition">¶</a></dt>
<dd><p>Port of the RGW daemons</p>
</dd></dl>

<dl class="py attribute">
<dt id="ceph.deployment.service_spec.RGWSpec.rgw_frontend_ssl_certificate">
<code class="sig-name descname"><span class="pre">rgw_frontend_ssl_certificate</span></code><em class="property"><span class="pre">:</span> <span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">List</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">]</span></span></em><a class="headerlink" href="#ceph.deployment.service_spec.RGWSpec.rgw_frontend_ssl_certificate" title="Permalink to this definition">¶</a></dt>
<dd><p>List of SSL certificates</p>
</dd></dl>

<dl class="py attribute">
<dt id="ceph.deployment.service_spec.RGWSpec.rgw_frontend_type">
<code class="sig-name descname"><span class="pre">rgw_frontend_type</span></code><em class="property"><span class="pre">:</span> <span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">]</span></span></em><a class="headerlink" href="#ceph.deployment.service_spec.RGWSpec.rgw_frontend_type" title="Permalink to this definition">¶</a></dt>
<dd><p>civetweb or beast (default: beast). See <a class="reference internal" href="../../../radosgw/frontends/#rgw-frontends"><span class="std std-ref">HTTP 前端</span></a></p>
</dd></dl>

<dl class="py attribute">
<dt id="ceph.deployment.service_spec.RGWSpec.rgw_realm">
<code class="sig-name descname"><span class="pre">rgw_realm</span></code><em class="property"><span class="pre">:</span> <span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">]</span></span></em><a class="headerlink" href="#ceph.deployment.service_spec.RGWSpec.rgw_realm" title="Permalink to this definition">¶</a></dt>
<dd><p>The RGW realm associated with this service. Needs to be manually created</p>
</dd></dl>

<dl class="py attribute">
<dt id="ceph.deployment.service_spec.RGWSpec.rgw_zone">
<code class="sig-name descname"><span class="pre">rgw_zone</span></code><em class="property"><span class="pre">:</span> <span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">]</span></span></em><a class="headerlink" href="#ceph.deployment.service_spec.RGWSpec.rgw_zone" title="Permalink to this definition">¶</a></dt>
<dd><p>The RGW zone associated with this service. Needs to be manually created</p>
</dd></dl>

<dl class="py attribute">
<dt id="ceph.deployment.service_spec.RGWSpec.ssl">
<code class="sig-name descname"><span class="pre">ssl</span></code><a class="headerlink" href="#ceph.deployment.service_spec.RGWSpec.ssl" title="Permalink to this definition">¶</a></dt>
<dd><p>enable SSL</p>
</dd></dl>

</dd></dl>

</div>
</div>
<div class="section" id="high-availability-service-for-rgw">
<span id="orchestrator-haproxy-service-spec"></span><h2>High availability service for RGW<a class="headerlink" href="#high-availability-service-for-rgw" title="Permalink to this headline">¶</a></h2>
<p>The <em>ingress</em> service allows you to create a high availability endpoint
for RGW with a minumum set of configuration options.  The orchestrator will
deploy and manage a combination of haproxy and keepalived to provide load
balancing on a floating virtual IP.</p>
<p>If SSL is used, then SSL must be configured and terminated by the ingress service
and not RGW itself.</p>
<img alt="../../../_images/HAProxy_for_RGW.svg" src="../../../_images/HAProxy_for_RGW.svg" /><p>There are N hosts where the ingress service is deployed.  Each host
has a haproxy daemon and a keepalived daemon.  A virtual IP is
automatically configured on only one of these hosts at a time.</p>
<p>Each keepalived daemon checks every few seconds whether the haproxy
daemon on the same host is responding.  Keepalived will also check
that the master keepalived daemon is running without problems.  If the
“master” keepalived daemon or the active haproxy is not responding,
one of the remaining keepalived daemons running in backup mode will be
elected as master, and the virtual IP will be moved to that node.</p>
<p>The active haproxy acts like a load balancer, distributing all RGW requests
between all the RGW daemons available.</p>
<div class="section" id="prerequisites">
<h3>Prerequisites<a class="headerlink" href="#prerequisites" title="Permalink to this headline">¶</a></h3>
<ul class="simple">
<li><p>An existing RGW service, without SSL.  (If you want SSL service, the certificate
should be configured on the ingress service, not the RGW service.)</p></li>
</ul>
</div>
<div class="section" id="deploying">
<h3>Deploying<a class="headerlink" href="#deploying" title="Permalink to this headline">¶</a></h3>
<p>Use the command:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">orch</span> <span class="n">apply</span> <span class="o">-</span><span class="n">i</span> <span class="o">&lt;</span><span class="n">ingress_spec_file</span><span class="o">&gt;</span>
</pre></div>
</div>
</div>
<div class="section" id="id1">
<h3>Service specification<a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h3>
<p>It is a yaml format file with the following properties:</p>
<div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="nt">service_type</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">ingress</span>
<span class="nt">service_id</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">rgw.something</span>    <span class="c1"># adjust to match your existing RGW service</span>
<span class="nt">placement</span><span class="p">:</span>
  <span class="nt">hosts</span><span class="p">:</span>
    <span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">host1</span>
    <span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">host2</span>
    <span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">host3</span>
<span class="nt">spec</span><span class="p">:</span>
  <span class="nt">backend_service</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">rgw.something</span>      <span class="c1"># adjust to match your existing RGW service</span>
  <span class="nt">virtual_ip</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">&lt;string&gt;/&lt;string&gt;</span>       <span class="c1"># ex: 192.168.20.1/24</span>
  <span class="nt">frontend_port</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">&lt;integer&gt;</span>            <span class="c1"># ex: 8080</span>
  <span class="nt">monitor_port</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">&lt;integer&gt;</span>             <span class="c1"># ex: 1967, used by haproxy for load balancer status</span>
  <span class="nt">virtual_interface_networks</span><span class="p">:</span> <span class="p p-Indicator">[</span> <span class="nv">...</span> <span class="p p-Indicator">]</span> <span class="c1"># optional: list of CIDR networks</span>
  <span class="nt">ssl_cert</span><span class="p">:</span> <span class="p p-Indicator">|</span>                         <span class="c1"># optional: SSL certificate and key</span>
    <span class="no">-----BEGIN CERTIFICATE-----</span>
    <span class="no">...</span>
    <span class="no">-----END CERTIFICATE-----</span>
    <span class="no">-----BEGIN PRIVATE KEY-----</span>
    <span class="no">...</span>
    <span class="no">-----END PRIVATE KEY-----</span>
</pre></div>
</div>
<p>where the properties of this service specification are:</p>
<ul class="simple">
<li><dl class="simple">
<dt><code class="docutils literal notranslate"><span class="pre">service_type</span></code></dt><dd><p>Mandatory and set to “ingress”</p>
</dd>
</dl>
</li>
<li><dl class="simple">
<dt><code class="docutils literal notranslate"><span class="pre">service_id</span></code></dt><dd><p>The name of the service.  We suggest naming this after the service you are
controlling ingress for (e.g., <code class="docutils literal notranslate"><span class="pre">rgw.foo</span></code>).</p>
</dd>
</dl>
</li>
<li><dl class="simple">
<dt><code class="docutils literal notranslate"><span class="pre">placement</span> <span class="pre">hosts</span></code></dt><dd><p>The hosts where it is desired to run the HA daemons. An haproxy and a
keepalived container will be deployed on these hosts.  These hosts do not need
to match the nodes where RGW is deployed.</p>
</dd>
</dl>
</li>
<li><dl class="simple">
<dt><code class="docutils literal notranslate"><span class="pre">virtual_ip</span></code></dt><dd><p>The virtual IP (and network) in CIDR format where the ingress service will be available.</p>
</dd>
</dl>
</li>
<li><dl class="simple">
<dt><code class="docutils literal notranslate"><span class="pre">virtual_interface_networks</span></code></dt><dd><p>A list of networks to identify which ethernet interface to use for the virtual IP.</p>
</dd>
</dl>
</li>
<li><dl class="simple">
<dt><code class="docutils literal notranslate"><span class="pre">frontend_port</span></code></dt><dd><p>The port used to access the ingress service.</p>
</dd>
</dl>
</li>
<li><dl class="simple">
<dt><code class="docutils literal notranslate"><span class="pre">ssl_cert</span></code>:</dt><dd><p>SSL certificate, if SSL is to be enabled. This must contain the both the certificate and
private key blocks in .pem format.</p>
</dd>
</dl>
</li>
</ul>
</div>
<div class="section" id="selecting-ethernet-interfaces-for-the-virtual-ip">
<span id="ingress-virtual-ip"></span><h3>Selecting ethernet interfaces for the virtual IP<a class="headerlink" href="#selecting-ethernet-interfaces-for-the-virtual-ip" title="Permalink to this headline">¶</a></h3>
<p>You cannot simply provide the name of the network interface on which
to configure the virtual IP because interface names tend to vary
across hosts (and/or reboots).  Instead, cephadm will select
interfaces based on other existing IP addresses that are already
configured.</p>
<p>Normally, the virtual IP will be configured on the first network
interface that has an existing IP in the same subnet.  For example, if
the virtual IP is 192.168.0.80/24 and eth2 has the static IP
192.168.0.40/24, cephadm will use eth2.</p>
<p>In some cases, the virtual IP may not belong to the same subnet as an existing static
IP.  In such cases, you can provide a list of subnets to match against existing IPs,
and cephadm will put the virtual IP on the first network interface to match.  For example,
if the virtual IP is 192.168.0.80/24 and we want it on the same interface as the machine’s
static IP in 10.10.0.0/16, you can use a spec like:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">service_type</span><span class="p">:</span> <span class="n">ingress</span>
<span class="n">service_id</span><span class="p">:</span> <span class="n">rgw</span><span class="o">.</span><span class="n">something</span>
<span class="n">spec</span><span class="p">:</span>
  <span class="n">virtual_ip</span><span class="p">:</span> <span class="mf">192.168.0.80</span><span class="o">/</span><span class="mi">24</span>
  <span class="n">virtual_interface_networks</span><span class="p">:</span>
    <span class="o">-</span> <span class="mf">10.10.0.0</span><span class="o">/</span><span class="mi">16</span>
  <span class="o">...</span>
</pre></div>
</div>
<p>A consequence of this strategy is that you cannot currently configure the virtual IP
on an interface that has no existing IP address.  In this situation, we suggest
configuring a “dummy” IP address is an unroutable network on the correct interface
and reference that dummy network in the networks list (see above).</p>
</div>
<div class="section" id="useful-hints-for-ingress">
<h3>Useful hints for ingress<a class="headerlink" href="#useful-hints-for-ingress" title="Permalink to this headline">¶</a></h3>
<ul class="simple">
<li><p>It is good to have at least 3 RGW daemons.</p></li>
<li><p>We recommend at least 3 hosts for the ingress service.</p></li>
</ul>
</div>
</div>
<div class="section" id="further-reading">
<h2>Further Reading<a class="headerlink" href="#further-reading" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li><p><a class="reference internal" href="../../../radosgw/#object-gateway"><span class="std std-ref">Ceph 对象网关</span></a></p></li>
</ul>
</div>
</div>



           </div>
           
          </div>
          <footer>
    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
        <a href="../mds/" class="btn btn-neutral float-right" title="MDS Service" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
        <a href="../osd/" class="btn btn-neutral float-left" title="OSD Service" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
    </div>

  <hr/>

  <div role="contentinfo">
    <p>
        &#169; Copyright 2016, Ceph authors and contributors. Licensed under Creative Commons Attribution Share Alike 3.0 (CC-BY-SA-3.0).

    </p>
  </div> 

</footer>
        </div>
      </div>

    </section>

  </div>
  

  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>

  
  
    
   

</body>
</html>